package se.cbb.scripts;

import java.io.BufferedReader;
import java.io.FileReader;
import java.util.ArrayList;

import se.cbb.misc.Sequence;
import se.cbb.misc.SequenceFileWriter;
import se.cbb.misc.SimpleFileIO;

public class TempScript {

	public static void main(String[] args) {
		try {
			String path = "/Users/rhali/Desktop/";
			String str;
			int index = 1;
			
			BufferedReader bufferedreader = new BufferedReader(new FileReader(path + "FileNames.sh"));
			while ((str = bufferedreader.readLine()) != null) {
				SequenceFileWriter.writeAndAppendLine(path, "jprimeScript" + index + ".sh", "#!/bin/bash");
				SequenceFileWriter.writeAndAppendLine(path, "jprimeScript" + index + ".sh", "");
				SequenceFileWriter.writeAndAppendLine(path, "jprimeScript" + index + ".sh", "#SBATCH -A snic2014-3-5");
				SequenceFileWriter.writeAndAppendLine(path, "jprimeScript" + index + ".sh", "#SBATCH -p core");
				SequenceFileWriter.writeAndAppendLine(path, "jprimeScript" + index + ".sh", "#SBATCH -n 1");
				SequenceFileWriter.writeAndAppendLine(path, "jprimeScript" + index + ".sh", "#SBATCH -t 239:55:00");
				SequenceFileWriter.writeAndAppendLine(path, "jprimeScript" + index + ".sh", "#SBATCH -J " + "SR2-" + str);
				SequenceFileWriter.writeAndAppendLine(path, "jprimeScript" + index + ".sh", "");
				SequenceFileWriter.writeAndAppendLine(path, "jprimeScript" + index + ".sh", "java -Xmx2900m -Xms2800m -jar jprime-0.0.1-SNAPSHOT.jar Delirious RealTree.nwk ./Sequences/GeneTree" + str + ".fa ./Mapping/GeneTree" + str + ".map -o GeneTree" + str + ".mcmc -sm JTT -i 5000000");
				index++;
			}
			
			bufferedreader.close();
		} catch (Exception e) {
			System.out.println("Error : " + e.getMessage());
		}


	}

}
